package com.kma.summer2012.client.events.request;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.kma.summer2012.shared.model.UICrumbsRequest;

import java.util.List;

public class DeleteRequestEvent extends GwtEvent<DeleteRequestEvent.DeleteRequestEventHandler> {
    private static Type<DeleteRequestEventHandler> TYPE = new Type<DeleteRequestEventHandler>();
    public List<UICrumbsRequest> requests = null;

    public DeleteRequestEvent(List<UICrumbsRequest> requests) {
        this.requests = requests;
    }

    @Override
    public Type<DeleteRequestEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(DeleteRequestEventHandler deleteRequestEventHandler) {
        deleteRequestEventHandler.OnDeleteRequest(this);
    }

    public static Type<DeleteRequestEventHandler> getType() {
        return TYPE;
    }

    public interface DeleteRequestEventHandler extends EventHandler {
        void OnDeleteRequest(DeleteRequestEvent event);
    }
}